<template>
    <div class="player">
    <div class="song-info"></div>
    <div class="song-pic">
        <img :src="singer.cover" alt="">
    </div>
    <div class="song-control">
        <audio :src="songUrl" controls autoplay></audio>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return {
            songUrl:"",
            singer: {}
        }
    },
    created(){
        this.getData();
        this.getStoreSinger()
    },
    methods:{
        getData(){
            axios.get("/jsososo/song/urls",{
                params:{
                    id:this.$route.params.id
                }
            })
            .then(res => {
              //  console.log(res.data)
              this.songUrl = res.data.data[this.$route.params.id]
            })
            .catch(err => {
                console.error(err); 
            })
        },
        getStoreSinger(){
            // console.log(this.$store.getters.singer)
            this.singer = this.$store.getters.singer
        }
    }
}
</script>
<style scoped>

</style>
